


#iChannel0 "file://lv_1.png"


void rect(vec2 st){

}


// iResolution  已知
// iTime 已知
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 st = fragCoord/iResolution.xy;
    vec3 color = vec3(0.0);
    // fragColor = texture(iChannel0, st);

    vec2 tapPoint = vec2(iMouse.x/iResolution.x,iMouse.y/iResolution.y);
    vec2 pToEdge = st - tapPoint;
    float aspectRatio = iResolution.x/iResolution.y;
    pToEdge.x *= aspectRatio;
    float fdist = length(pToEdge);
    if(fdist < 0.2){
        // 在这个范围内
        vec4 oldColor =  texture(iChannel0, st);

        float waveSpeed = 5.0;
        float modifiedTime = iTime * waveSpeed;
        float frequency = 2.0;
        // float addend = abs(sin(frequency*fdist-modifiedTime));

        float t = mod(iTime,3.1415);
        if( t >= 3.0){
            fragColor = vec4(oldColor.rgb,1.0);
        }else{
            float modifiedTime = iTime * waveSpeed;
            float param = abs(sin(t * frequency) );
            oldColor.rgb = param * oldColor.rgb;   

            
            fragColor = vec4(oldColor.rgb,1.0);
        }
        
    }else{
            fragColor = texture(iChannel0, st);
    }

    

    // float waveStrength = 0.02;
    // float frequency = 30.0;
    // float waveSpeed = 5.0;
    // vec4 sunlightColor = vec4(1.0,0.91,0.75, 1.0);
    // float sunlightStrength = 0.0;
    // float centerLight = 2.;
    // float oblique = .25; 
        
    // vec2 tapPoint = vec2(iMouse.x/iResolution.x,iMouse.y/iResolution.y);

    // if(iTime >= 1.0){
    //     fragColor = texture(iChannel0, st);
    // }else{
    //     vec2 uv = fragCoord.xy / iResolution.xy;
    //     float modifiedTime = iTime * waveSpeed;
    //     float aspectRatio = iResolution.x/iResolution.y;
    //     vec2 distVec = uv - tapPoint;
    //     distVec.x *= aspectRatio;
    //     float distance = length(distVec);

    //     float multiplier = (distance < 1.0) ? ((distance-1.0)*(distance-1.0)) : 0.0;
    //     float addend = (sin(frequency*distance-modifiedTime)+centerLight) * waveStrength * multiplier;
    //     vec2 newTexCoord = uv + addend*oblique;    

    //     vec4 colorToAdd = sunlightColor * sunlightStrength * addend;

	//     fragColor = texture(iChannel0, newTexCoord) + colorToAdd;
    // }

    // if(tapPoint.x < 0.5){
    //     // 左边动
       
    // }else{
    //     // 右边停
    //     fragColor = texture(iChannel0, st);
    // }
	
   
}